package net.mingsoft.basic.aop;

import org.springframework.stereotype.*;
import net.mingsoft.basic.biz.*;
import javax.annotation.*;
import net.mingsoft.basic.bean.*;
import org.aspectj.lang.*;
import cn.hutool.crypto.*;
import org.aspectj.lang.annotation.*;

@Component
@Aspect
public class ManagerPasswordAop extends BaseAop
{
    @Resource
    IManagerBiz managerBiz;
    
    @Pointcut("execution(* net.mingsoft.basic.action.MainAction.updatePassword(..))")
    public void updatePassword() {
    }
    
    @Around("updatePassword()")
    public Object updatePassword(final ProceedingJoinPoint joinPoint) throws Throwable {
        this.LOG.debug("basic ManagerPasswordAop \u4fee\u6539\u5bc6\u7801\u4e3amd5");
        final ManagerModifyPwdBean managerModifyPwdBean = super.getType((JoinPoint)joinPoint, ManagerModifyPwdBean.class);
        managerModifyPwdBean.setOldManagerPassword(SecureUtil.md5(managerModifyPwdBean.getOldManagerPassword()));
        return joinPoint.proceed();
    }
}
